package com.ruoyi.permission.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.permission.mapper.permissionMapper;
import com.ruoyi.permission.domain.permission;
import com.ruoyi.permission.service.IpermissionService;

/**
 * 菜单权限Service业务层处理
 * 
 * @author pengjie
 * @date 2023-12-21
 */
@Service
public class permissionServiceImpl implements IpermissionService 
{
    @Autowired
    private permissionMapper permissionMapper;

    /**
     * 查询菜单权限
     * 
     * @param id 菜单权限主键
     * @return 菜单权限
     */
    @Override
    public permission selectpermissionById(String id)
    {
        return permissionMapper.selectpermissionById(id);
    }

    /**
     * 查询菜单权限列表
     * 
     * @param permission 菜单权限
     * @return 菜单权限
     */
    @Override
    public List<permission> selectpermissionList(permission permission)
    {
        return permissionMapper.selectpermissionList(permission);
    }

    /**
     * 新增菜单权限
     * 
     * @param permission 菜单权限
     * @return 结果
     */
    @Override
    public int insertpermission(permission permission)
    {
        permission.setCreateTime(DateUtils.getNowDate());
        return permissionMapper.insertpermission(permission);
    }

    /**
     * 修改菜单权限
     * 
     * @param permission 菜单权限
     * @return 结果
     */
    @Override
    public int updatepermission(permission permission)
    {
        permission.setUpdateTime(DateUtils.getNowDate());
        return permissionMapper.updatepermission(permission);
    }

    /**
     * 批量删除菜单权限
     * 
     * @param ids 需要删除的菜单权限主键
     * @return 结果
     */
    @Override
    public int deletepermissionByIds(String[] ids)
    {
        return permissionMapper.deletepermissionByIds(ids);
    }

    /**
     * 删除菜单权限信息
     * 
     * @param id 菜单权限主键
     * @return 结果
     */
    @Override
    public int deletepermissionById(String id)
    {
        return permissionMapper.deletepermissionById(id);
    }
}
